const bindAnnotation = (bindingFunction, {type}) => {
  if (type === "class") {
    return function (...args) {
      if(args[0] instanceof Function){
        bindingFunction.apply(this, args)
      } else {  // 工厂函数
        return (Ctor) => {
          console.log(typeof Ctor)
          return bindingFunction.apply(this, [Ctor, ...args])
        }
      }
    }
  }
  if (type === "method") {

  }
}


const bindClass = bindingFunction => bindAnnotation(bindingFunction, {type: "class"})
const bindMethod = bindingFunction => bindAnnotation(bindingFunction, {type: "method"})


module.exports = {
  bindClass,
  bindMethod
}
